#!/bin/sh
gytest="获取app最新master_release_id"
# 输出结果到文件
#curl -o res.text -X GET -H 'Content-Type: application/json; charset=utf-8' -G -d 'api_token=afe6416ded4e08574a925f11c66ba23e' http://api.bq04.com/apps/6213730823389f1907549c7c
#echo ${gytest}
#gytest=$(cat res.text)
#echo ${gytest}
gytest=$(curl -X GET -H 'Content-Type: application/json; charset=utf-8' -G -d 'api_token=afe6416ded4e08574a925f11c66ba23e' http://api.bq04.com/apps/6213730823389f1907549c7c)
#echo ${gytest}
master_release_id=$(echo ${gytest} | sed 's/,/\n/g' | grep 'master_release_id' | sed 's/:/\n/g' | sed '1d' | sed 's/"//g' | sed 's/}//g')
echo "最新master_release_id:=>${master_release_id}"
downloadUrl="http://d.3appstore.com/8cgm?release_id=${master_release_id}"
echo "最新下载链接：=> ${downloadUrl}"
qrUrl="https://api.qrserver.com/v1/create-qr-code/?data=${downloadUrl}"
echo "最新二维码图片链接：=> ${qrUrl}"
